package Propertics属性集合对象;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Properties;

public class 输出数据到文件中 {
    public static void main(String[] args) throws IOException {

        OutputStream outputStream = new  FileOutputStream("day10/src/file/properties.properties");

        Properties properties = new Properties();
        properties.setProperty("root","root");  //底层就是调用Map集合的put方法
        properties.setProperty("Root","123456");
        properties.setProperty("admin","admin");

        properties.store(outputStream,"this is log,the first.this haven't chinese,beause to 乱码");
//        方法会自动刷新
    }
}
